// create the base ANSW object if it does not exist.
if (typeof ANSW=="undefined") {
ANSW = new Object();
}
ANSW.alert= function(msg){
// alert(msg)
};
ANSW.console = function(msg){
//if(window.console) window.console.log(msg);
};
ANSW.Init = function(nafid,cobrand)
{
ANSW.nafid = nafid;
ANSW.cobrand = cobrand;
};
/* Class: ANSW.Balloon
Provides a flexible, encapsulated way to implement a passive feedback mechanism
in a DHTML environment. Define and initialize this object globally, otherwise it will create a new instance
each time you call it's constructor. Set up the object with an object array passed to the constructor or, once instantiated,
with properties. See <Usage> for more.
*/
ANSW.Balloon = function()
{
var oldkeyup;
this.oldkeyup = oldkeyup;
var oldmousedown;
this.oldmousedown = oldmousedown;
var oldmouseup;
this.oldmouseup = oldmouseup;
var oldcontextmenu;
this.oldcontextmenu = oldcontextmenu;
var oldmousemove;
this.oldmousemove = oldmousemove;
var tmrIFrameGone;
this.tmrIFrameGone = tmrIFrameGone;
var blbWidth=200;
this.blbWidth = blbWidth;
this.showCloseBox=false;
this.initBalloon = function()
{
if(arguments.length>0)
{
var oArg=arguments[0];
if(oArg.width!=null)
{
this.blbWidth=oArg.width;
}
this.width=this.blbWidth;
}
};
var childID;
this.childID= childID;
// Public Methods
this.Show=Show;
this.Hide=Hide;
this.isVisible=isVisible;
/* Function: Show
Makes the instantiated balloon appear.
Balloon content note:
Because SELECT objects are what's known as windowed controles
they need to be hidden when balloons are shown, otherwise they will always be on top
(they ignore zIndex attribute). It is normally done automatically by this control.
Sometimes, however, you may want to place a drop-down inside the balloon itself.
To override this default behaviour add an balloonMember expando attirbute to
the SELECT you are placing withing.
- e.g. <SELECT id=select1 name=select1 balloonMember=true>
Syntax:
(start code)
object.Show({[title:vTitle]
[,message:vMessage]
[,footer:vFooter]
[,top:vTop]
[,left:vLeft]
[,anchor:vAnchor]
[,icon:vIcon]
[,query:vQuery]
});
(end)
Possible Values:
vTitle - *string* Optional title text for the balloon.
vMessage - *string* Optional. Message body for the balloon.
vFooter - *string* Optional. Test displayed at the bottom of the balloon on a separate line.
vTop - *integer* Optional. Offset from the top of the screen or top of an anchor.
vLeft - *integer* Optional. Offset from the left of the screen or left of an anchor.
vAnchor - *object* Optional. Reference to the object that the balloon should use as reference for location.
vIcon - *string* Optional. Possible icon values may include one of the values below (case sensitive):
- Exclaim - pre-defined, triangle with an exclamation point.
- Stop - pre-defined, red circle with a white x inside.
- Info - pre-defined, white balloon with a letter "i" inside *Default*
- Help - a question mark inside a blue circle.
- a relative path to a custom icon.
vQuery - *query string*
Examples:
- balloonObj.Show({title:'JavaScript Balloon Example',message:'This is an example of a JSBalloon object. It\'s primary application is to provide a modeless feedback to DHTML applications.',anchor:tableCellObj, icon:'Info'});
- balloonObj1.Show({title:'JavaScript Balloon Example',message:'This is an example of a JSBalloon object. It\'s primary application is to provide a modeless feedback to DHTML applications.',anchor:tableCellObj});
- balloonObj2.Show({message:'This is an example of a JSBalloon object. It\'s primary application is to provide a modeless feedback to DHTML applications. ',anchor:tableCellObj});
*/
function Show()
{
var title;
var btop=0, bleft=0;
var atop=0, aleft=0;
var anchor;
var direction='SE';
var query ='';
var nafid='';
var cobrand='';
var nohook = false;
var parent = null;
var ads=0;
var mydoc= ANSW.isFirefoxExtension ? window.content.document : document;
blbWidth=String(this.width) + "px";
// Updates
if(Show.arguments.length>0)
{
var oArg=Show.arguments[0];
if(oArg.title!=null)
{
title=oArg.title;
}
if(oArg.top!=null)
{
btop=oArg.top;
}
if(oArg.left!=null)
{
bleft=oArg.left;
}
if(oArg.anchor!=null)
{
anchor=oArg.anchor;
atop=getTop(anchor);
aleft=getLeft(anchor);
}
if(oArg.query!=null)
{
query=oArg.query;
}
if(oArg.nafid!=null)
{
nafid=oArg.nafid;
}
if(oArg.cobrand!=null)
{
cobrand=oArg.cobrand;
}
if(oArg.nohook!=null)
{
nohook= true;
}
if(oArg.parent!=null)
{
parent= oArg.parent;
}
if(oArg.ads!=null)
{
ads= oArg.ads;
}
}
if (parent)
{
mydoc = parent.parentNode;
mydoc= mydoc.parentNode;
ANSW.doc = mydoc;
}
var formerBalloon = mydoc.getElementById("AnswersBalloon");
'<u><b><a style="color:yellow;" href="/main/answertips.jsp?lid=AnswerTip_enable&lpos=ATip_bottom">AnswerTips</a></u> - you can double-click on any word on your page.</b>'+
'</DIV> </TD></TR>'+
'</div>'+
'</div>';
return balloon;
}
function ieFix(){
// also some css specific to IE to work around IE bugs
if(document.all){
var popupHeaderInner = document.getElementById('popup_header');
if (popupHeaderInner)
{
popupHeaderInner.style['margin'] = '0px 8px 18px 8px';
popupHeaderInner.style['width'] = '465px';
popupHeaderInner.style['padding-top'] = '8px';
}
var popupFooter = document.getElementById('popup_footer');
if (popupFooter)
popupFooter.style['margin-right'] = '4px';
// To add a shadow, use this. Comment out to disable
var popupFrameA = document.getElementById('popup_FrameA');